package com.imooc.security.order;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;

/**
 * @ClassName UserDetailsServiceImpl
 * @Description TODO
 * @Author wushaopei
 * @Date 2021/5/3 15:26
 * @Version 1.0
 */

@Component("userDetailsService")
public class UserDetailsServiceImpl implements UserDetailsService {

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        //这里就不去读数据库了
        User user = new User();
        user.setId(1L);
        user.setUsername(username);
        return user;
    }
}
